package fr.esisar.picaso.moteur;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class HashMD5 {

	public HashMD5(){
			
	}
	
	public String calculeMD5(String password) {
		try {
			byte[] hash;
			hash = MessageDigest.getInstance("MD5").digest((password).getBytes());
			String res = "";
			for(int i=0 ; i<hash.length ; i++){
				res += "" + hash[i];
			}
			System.out.println(res);
			return res;
			
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
			return null;
		}
	}
}
